import request from '@/util/request'
import store from '@/store'

// check user login
export function isLogin() {
  return request({
    url: '/api/execute/user/is-login',
    method: 'post',
    data: {
      token: store.getters['ExecUser/token']
    }
  })
}

// --------------------------------------------------------

// check favorite
export function checkFavorite(data) {
  return request({
    url: '/api/execute/fav/check',
    method: 'post',
    data
  })
}

// fav create
export function createFav(data) {
  return request({
    url: '/api/execute/fav/create',
    method: 'post',
    data
  })
}

// fav delete
export function removeFav(data) {
  return request({
    url: '/api/execute/fav/delete',
    method: 'post',
    data
  })
}

// fav list
export function favList(data) {
  return request({
    url: '/api/execute/fav/list',
    method: 'post',
    data
  })
}

// 排行榜
export function rankList(data) {
  return request({
    url: '/api/rank/list',
    method: 'post',
    data
  })
}

// --------------------------------------------------------

// subscribe
export function subscribe(data) {
  return request({
    url: '/api/execute/user/subscribe',
    method: 'post',
    data
  })
}

// --------------------------------------------------------

// user qrcode list
export function qrcodeList(data) {
  return request({
    url: '/api/execute/user/qrcode',
    method: 'post',
    data
  })
}

// --------------------------------------------------------

// about
export function about(data) {
  return request({
    url: '/api/execute/user/about',
    method: 'post',
    data
  })
}

// service
export function service(data) {
  return request({
    url: '/api/execute/user/service',
    method: 'post',
    data
  })
}

// fetch bank
export function bankFetch(data) {
  return request({
    url: '/api/execute/user/fetch-bank',
    method: 'post',
    data
  })
}

// edit bank
export function bankEdit(data) {
  return request({
    url: '/api/execute/user/edit-bank',
    method: 'post',
    data
  })
}

// check pay password
export function checkPayPassword(data) {
  return request({
    url: '/api/execute/user/check-pay-password',
    method: 'post',
    data
  })
}

// edit pay password
export function editPayPassword(data) {
  return request({
    url: '/api/execute/user/edit-pay-password',
    method: 'post',
    data
  })
}

export function resetPayPassword(data) {
  return request({
    url: '/api/execute/user/reset-pay-password',
    method: 'post',
    data
  })
}

// --------------------------------------------------------

// check sign in
export function checkSignIn(data) {
  return request({
    url: '/api/execute/user/check-sign-in-for-day',
    method: 'post',
    data
  })
}

// sign in
export function signIn(data) {
  return request({
    url: '/api/execute/user/sign-in',
    method: 'post',
    data
  })
}

// sign in list
export function signInList(data) {
  return request({
    url: '/api/execute/user/sign-in-list',
    method: 'post',
    data
  })
}

// --------------------------------------------------------

// 转让
export function transfer(data) {
  return request({
    url: '/api/transfer/execute',
    method: 'post',
    data
  })
}
